package com.show.pm.conf;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

@Configuration//druid数据源配置类
public class DruidConfig {
    @Bean
    @ConfigurationProperties(prefix = "spring.datasource")//加载时读取指定的配置信息,前缀为spring.datasource.druid
    public DataSource druidDataSource(){
        return new DruidDataSource();
    }
}